<script setup lang="ts" name="HistoryLogs">
import useHistoryIndex from '@/components/index/history/hooks/historyIndex'
const { historyLogsData, actived, logsClicked } = useHistoryIndex()
</script>

<template>
  <ul>
    <li
      class="default-button"
      v-for="item in historyLogsData"
      :key="item.time"
      tabindex="0"
      @click="logsClicked(item.time)"
      :class="{ actived: actived === item.time }"
    >
      <div class="bottom">
        <b>{{ item.time }}</b>
        <span>{{ item.items }}</span>
      </div>
    </li>
  </ul>
</template>

<style scoped lang="less">
ul {
  list-style: none;
  .actived {
    border: 2px solid var(--color3);

    border-color: var(--color3);
    color: var(--color3);
  }
  li:hover {
    border: 2px solid var(--color3);
  }
  li {
    cursor: pointer;
    margin: 20px auto;
    height: 30px;
    width: 70%;
    background-color: var(--color2);
    box-sizing: border-box;

    .bottom {
      padding: 0 20px;
      color: inherit;

      b {
        font-size: 18px;
        line-height: 30px;
        float: left;
        color: inherit;
      }
      span {
        font-size: 14px;
        line-height: 30px;
        float: right;
        color: inherit;
      }
    }
  }
}
</style>
